home *** CD-ROM | disk | FTP | other *** search
-
- REM This program will read the ASCII file containing the SIGCAT CD-ROM
- REM Compendium converted from WordPerfect 5.1 and parse the fields
- REM into a GSSEARCH TAG file format
- REM 4/9/94
- REM
- CLS
- SCREEN 9
- DIM V$(100)
- DIM S$(100)
-
-
- INPUT "Input ASCII file to be processed "; FIN$
- OPEN "I", #1, FIN$
- REM OPEN "I", #1, "COMPIN"
-
- INPUT "Output GSSEARCH TAG file to be created "; FOUT$
- OPEN "O", #2, FOUT$
- REM OPEN "O", #2, "COMPOUT"
-
- REM First read to find start line:
- REM * in Col. 1
-
- A$ = ""
- WHILE NOT EOF(1)
- REM Read and start processing
-
- WHILE MID$(A$, 1, 1) <> "*"
- IF EOF(1) THEN 400
- LINE INPUT #1, A$
- REM PRINT a$
- REM INPUT "Cont"; Q$
-
- WEND
-
- PRINT #2, "{TITLE}" + MID$(A$, 2, 79)
-
- REM Read past blanks looking for either "Subtitle" or "Description"
- LINE INPUT #1, A$
-
- WHILE MID$(A$, 1, 1) = ""
- LINE INPUT #1, A$
- WEND
-
-
- IF MID$(A$, 1, 3) = "Sub" THEN
- PRINT #2, "{SUBTITLE}" + LTRIM$(MID$(A$, 10, 79))
- REM Read past blanks looking for "Description"
- LINE INPUT #1, A$
- WHILE MID$(A$, 1, 1) = ""
- LINE INPUT #1, A$
- WEND
- END IF
-
- IF MID$(A$, 1, 3) = "Des" THEN
- PRINT #2, "{DESCRIPT}" + LTRIM$(MID$(A$, 13, 85))
- LINE INPUT #1, A$
- END IF
-
- REM Print description lines until "Documentation" found:
- REM Print remainder of first line:
- PRINT #2, MID$(A$, 1, 80)
- LINE INPUT #1, A$
- WHILE MID$(A$, 1, 14) <> "Documentation:"
- PRINT #2, A$
- LINE INPUT #1, A$
- WEND
- PRINT #2, "{DOCUMENTED}" + LTRIM$(MID$(A$, 15, 79))
- REM Read past blanks looking for "Vendor"
- LINE INPUT #1, A$
-
- WHILE MID$(A$, 1, 7) <> "Vendor/"
- LINE INPUT #1, A$
- WEND
- REM Vendor line found
- REM read next lines into V$ and S$ arrays until "Local Area" or "*" found
- x = 1
- y = 1
-
- REM initialize arrays to all "@"
- WHILE x < 100
- V$(x) = "@"
- S$(x) = "@"
- x = x + 1
- WEND
- x = 1
- y = 1
-
- WHILE MID$(A$, 1, 10) <> "Local Area" AND MID$(A$, 1, 1) <> "*"
- IF EOF(1) THEN 69
- LINE INPUT #1, A$
- REM PRINT A$
- REM INPUT "THIS WAS THE WHOLE LINE...OK"; q$
-
-
- REM skip garbage line:
- IF MID$(A$, 2, 4) <> MID$(A$, 8, 4) THEN
- V$(x) = MID$(A$, 1, 30)
- REM PRINT V$(x)
- REM INPUT "THIS WAS V$(x)"; q$
-
- x = x + 1
- END IF
-
- IF MID$(A$, 32, 4) <> MID$(A$, 38, 4) THEN
- S$(y) = MID$(A$, 31, 50)
- y = y + 1
- END IF
-
- WEND
-
- REM At this point, the arrays are filled; process them:
- REM print arrsys
- REM x = 1
- REM WHILE x < 100
- REM PRINT V$(x)
- REM x = x + 1
- REM WEND
- REM INPUT "END OF V ARRAY"; q$
-
- REM x = 1
- REM WHILE x < 100
- REM PRINT S$(x)
- REM x = x + 1
- REM WEND
- REM INPUT "END OF V ARRAY"; q$
-
- 69
-
- PRINT #2, "{SUPPLIER}"
- REM output lines until "Contact:" found
- x = 1
- WHILE MID$(V$(x), 1, 8) <> "Contact:"
- REM outputting SUPPLIER lines:
- PRINT #2, V$(x)
- IF MID$(V$(x), 1, 1) = "@" GOTO 100
- x = x + 1
- WEND
-
- PRINT #2, "{CONTACT}"
- REM output lines until "Status" found
- REM skip "Contact:" line:
- x = x + 1
- IF MID$(V$(x), 1, 1) = "@" GOTO 100
-
- WHILE MID$(V$(x), 1, 6) <> "Status"
- REM outputting CONTACT lines:
- PRINT #2, V$(x)
- IF MID$(V$(x), 1, 1) = "@" GOTO 100
- x = x + 1
- WEND
-
- PRINT #2, "{STATUS}"
- REM skip "Status" line:
- x = x + 1
- IF MID$(V$(x), 1, 1) = "@" GOTO 100
- PRINT #2, LTRIM$(MID$(V$(x), 8, 30))
-
- REM search for "Entry Dated:"
- WHILE MID$(V$(x), 1, 12) <> "Entry Dated:"
- IF MID$(V$(x), 1, 1) = "@" GOTO 100
- x = x + 1
- WEND
-
- PRINT #2, "{CTRL_DATE}" + LTRIM$(MID$(V$(x), 13, 20))
-
- REM search for "Release Freq"
- WHILE MID$(V$(x), 1, 12) <> "Release Freq"
- IF MID$(V$(x), 1, 1) = "@" GOTO 100
- x = x + 1
- WEND
- PRINT #2, "{RELEASED}" + LTRIM$(MID$(V$(x), 19, 30))
-
- REM search for "Number of Di"
- WHILE MID$(V$(x), 1, 12) <> "Number of Di"
- IF MID$(V$(x), 1, 1) = "@" GOTO 100
- x = x + 1
- WEND
- PRINT #2, "{NUM_DISCS}" + LTRIM$(MID$(V$(x), 17, 30))
-
- REM search for "Price:"
- WHILE MID$(V$(x), 1, 6) <> "Price:"
- IF MID$(V$(x), 1, 1) = "@" GOTO 100
- x = x + 1
- WEND
- PRINT #2, "{PRICE}" + LTRIM$(MID$(V$(x), 7, 30))
-
-
-
- 100 REM The VENDOR STUFF has been output at this point; now SOURCE STUFF
- REM ********************************************************************
-
-
- PRINT #2, "{SOURCE}"
- REM SOURCE lines until "Contact:" found
- x = 1
- WHILE MID$(S$(x), 1, 8) <> "Contact:"
- REM outputting SOURCE lines:
- PRINT #2, S$(x)
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
- x = x + 1
- WEND
-
- PRINT #2, "{SPECIFIC}"
- REM output lines until "Technical" found
- REM skip "Contact:" line:
- x = x + 1
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
-
- WHILE MID$(S$(x), 1, 9) <> "Technical"
- REM outputting CONTACT lines:
- PRINT #2, S$(x)
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
- x = x + 1
- WEND
-
- PRINT #2, "{HARDWARE}"
- REM skip "Technical" line:
- x = x + 1
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
- PRINT #2, LTRIM$(MID$(S$(x), 11, 30))
- REM skip line:
- x = x + 1
-
- REM output remaining hardware info while searching for "CD Format:"
- WHILE MID$(S$(x), 1, 10) <> "CD Format:"
- PRINT #2, S$(x)
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
- x = x + 1
- WEND
-
- PRINT #2, "{CD_FORMAT}" + LTRIM$(MID$(S$(x), 11, 20))
- REM skip line:
- x = x + 1
-
- REM search for "Operating"
- WHILE MID$(S$(x), 1, 9) <> "Operating"
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
- x = x + 1
- WEND
- PRINT #2, "{OPER_SYS}" + LTRIM$(MID$(S$(x), 21, 30))
- REM skip line:
- x = x + 1
-
- REM output operating sys info while searching for "Memory Req"
- WHILE MID$(S$(x), 1, 10) <> "Memory Req"
- PRINT #2, S$(x)
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
- x = x + 1
- WEND
- PRINT #2, "{MEMORY_REQ}" + LTRIM$(MID$(S$(x), 20, 30))
- REM skip line:
- x = x + 1
-
- REM search for "Software:"
- WHILE MID$(S$(x), 1, 9) <> "Software:"
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
- x = x + 1
- WEND
- PRINT #2, "{SRCH_SOFT}" + LTRIM$(MID$(S$(x), 10, 30))
- REM skip line:
- x = x + 1
-
- REM output remaining search soft info while searching for "Video:"
- WHILE MID$(S$(x), 1, 6) <> "Video:"
- PRINT #2, S$(x)
- IF MID$(S$(x), 1, 1) = "@" GOTO 200
- x = x + 1
- WEND
- PRINT #2, "{VIDEO_REQ}" + LTRIM$(MID$(S$(x), 7, 30))
- REM skip line:
- x = x + 1
-
-
- 200 REM Done
-
-
- 250 PRINT #2, "{EOR}"
-
- 270 IF EOF(1) THEN 400
-
- 350 WEND
-
- 400 REM process last line
-
- CLS
-
- 500 PRINT "Normal end of file on input file"
- 600 CLOSE 1
- 610 CLOSE 2
- 630 SYSTEM
-